package com.unitd.base.frame.plugin.db.datasource.context;

/**
 * @author hudan
 * @version 1.0
 * @filename DataSourceContextHolder.java
 * @copyright www.unitd.com
 * @date 2020-07-08
 */
public class DataSourceContextHolder {
    private static final ThreadLocal<String> contextHolder = new ThreadLocal();

    public DataSourceContextHolder() {
    }

    public static void setDataSourceType(String dataSourceType) {
        contextHolder.set(dataSourceType);
    }

    public static String getDataSourceType() {
        return (String) contextHolder.get();
    }

    public static void clearDataSourceType() {
        contextHolder.remove();
    }
}